/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.sys.service.member;

import java.util.List;

import com.thinkgem.jeesite.modules.sys.dao.UserDao;
import com.thinkgem.jeesite.modules.sys.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.sys.entity.member.Member;
import com.thinkgem.jeesite.modules.sys.dao.member.MemberDao;

/**
 * 报警表Service
 * @author jin
 * @version 2018-04-10
 */
@Service
@Transactional(readOnly = true)
public class MemberService extends CrudService<MemberDao, Member> {

	@Autowired
	private MemberDao memberDao;

	public Member get(String id) {
		return super.get(id);
	}

	public Page<Member> findUser(Page<Member> page, Member member) {
		// 生成数据权限过滤条件（dsf为dataScopeFilter的简写，在xml中使用 ${sqlMap.dsf}调用权限SQL）
		member.getSqlMap().put("dsf", dataScopeFilter(member.getCurrentUser(), "o", "a"));
		// 设置分页参数
		member.setPage(page);
		// 执行分页查询
		page.setList(memberDao.findList(member));
		return page;
	}
	
	public List<Member> findList(Member member) {
		return super.findList(member);
	}
	
	public Page<Member> findPage(Page<Member> page, Member member) {
		member.getSqlMap().put("dsf", dataScopeFilter(member.getCurrentUser(), "o7", ""));
		return super.findPage(page, member);
	}
	
	@Transactional(readOnly = false)
	public void save(Member member) {
		super.save(member);
	}
	
	@Transactional(readOnly = false)
	public void delete(Member member) {
		super.delete(member);
	}

	public String checkIdCard(String IdCard){
		return dao.checkIdCard(IdCard);
	}
	
}